Relationship definition between entities

Overview

The Next Design metamodel allows you to define relationships between entities in addition to ownership relationships that represent parent-child relationships.

The procedure for defining relationships between entities is described below in the following order:

  • Related types
  • Add association
  • Delete association
  • Change related settings
  • Add fields to the association
  • Remove fields from associations
  • Redisplay associations deleted from class diagram

An image of a metamodel that includes relationships between entities

Metamodel containing relationships between entities


The types of associations available in the metamodel definition are:

Kind Description
Embedded Relationships that represent parent-child relationships and aggregations
Reference Relationships that represent usage and dependency relationships
Derivation Relationships that represent trace relationships with origins
Generalization Associations that represent inheriting characteristics

Reference

Add association

Describes how to add a relationship for each type of relationship.

Add ownership association

Adding or removing ownership relationships between entities is synonymous with defining the structure of a model. Please refer to Metamodel definition> Model structure definition for how to add/delete ownership relations.

add reference association

There are several ways to add reference associations between entities: Recommendation is the first method.

  • Add reference associations in class diagram
  • Add new reference association while modeling
    • Add new reference association while modeling with ER diagram
    • Add new reference associations while modeling in document form
    • Add new reference association while modeling with tree grid

The operation procedure for each of the above methods is explained below.

Add reference relation in class diagram

To add a reference relationship between entities using a class diagram:

Add Reference Relationship in Class Diagram

Operating procedure

  1. Display a class diagram that contains each other's entities that establish a reference relationship. If one of the entities is not included in the same class diagram, select Metamodel definition> Model structure definition> Add entity> Add existing entity to class diagram To add the entity to the class diagram.
  2. Move the pointer to the referencing entity, drag the [▲] icon displayed in the four directions, and drop it on the referent entity.
  3. When you drop it, a popup will pop up to choose the type of association and select Reference from the choices.
  4. This will define the lookup relationship between the entities, and you will be able to add a connector that represents the relationship to the view definition in the ER diagram.

Add new reference association while modeling with ER diagram

To add a new reference association while modeling with an ER diagram:

Add new reference association while modeling with ER diagram

Operating procedure

  1. Add two models on the ER diagram where you want to establish a reference association.
  2. Select the referencing entity, then hold down the Ctrl key and select the referencing entity.
  3. Click one of the following commands. (Both have the same behavior)
    • Ribbon [Profile]> [Diagram]> [Connector]> [Add Reference and Connector]
    • [Profile]> [Metamodel]> [Relationship] on the ribbon
    • [Shape]> [Shape]> [Connector]> [Add Reference and Connector] on the ribbon
    • Add Association in context menu ...
  4. Click to display the [New Connector Shape] dialog. After setting the items, click the [OK] button.
  5. This will make the following changes at once, connecting the association line between the two models.
    • Added reference relationships between entities in the metamodel
    • Define the connector that represents the relation in the view definition of the ER diagram
    • Add reference relationship between models

Note

  • New associations added to the metamodel will not automatically appear in existing class diagrams. If necessary, display it on the class diagram according to "Redisplay the association deleted from the class diagram" below.

Add new reference association while modeling with document form

To add a new reference association while modeling in a document form, do the following:

Add new reference relationship while modeling with document form

Operating procedure

  1. Select the reference source model on the document form (select a model other than the one displayed in the grid).
  2. Click one of the following commands to display the Add New Fields dialog. (Both are the same operation)
    • Ribbon Profile> Metamodel> Filelds
    • Ribbon Profile> Form> Add New Fields
    • Ribbon Form> Form> Add New Fields
    • Add new field in context menu ...
  3. Click the [...] button at the right end of [Data Type] of the setting item to open the finder for searching the referenced entity.
  4. Find the referenced entity in the list on the Finder and double-click it to populate the Data Type with the referenced entity.
  5. Select [Reference] from [Field Type] of the setting item, set other items, and then click the [OK] button.
  6. This will make the following changes at once and add the fields on the document form.
    • Added reference relationships between entities in the metamodel
    • Added a field representing the referenced model to the view definition of the document form

Add new reference association while modeling with tree grid

To add a new reference association while modeling in the tree grid, do the following:

Add new reference relationship while modeling with tree grid

Operating procedure

  1. Select the reference source model on the tree grid.
  2. Click one of the following commands to display the Add New Fields dialog. (Both are the same operation)
    • Ribbon Profile> Metamodel> Filelds
    • Ribbon Profile> Form> Add New Fields
    • Ribbon Form> Form> Add New Fields
    • Add new field in context menu ...
  3. Set the items in the [Add New Fields] dialog and click the [OK] button in the same way as in "Adding a new reference association while modeling with the document form" above.
  4. This will allow you to add the referenced model below the referenced model on the tree grid, making the following changes at once:
    • Added reference relationships between entities in the metamodel
    • Added a field that can display the reference model under the reference model in the view definition of the tree grid.

Add derivation association

To add a derived association using a class diagram:

Add Derived Relationship

Operating procedure

  1. Add each other's entities that connect the derivation associations to the class diagram.
  2. Move the pointer to the entity to be derived, drag the [▲] icon displayed in the four directions, and drop it on the entity to be derived.
  3. When dropped, a pop-up for selecting the related type will appear, and select [Derivation] from the choices.
  4. This defines the derivation relationships between the entities and allows derivation and addition of tracing relationships between models during modeling.

Tip

  • When defining a derived relation, it is recommended to add a new class diagram for defining only derived relations in addition to the existing class diagram. Since many derivation relationships are defined across metamodels, it is difficult to understand the excess or deficiency of derivation relationships in the entire metamodel if they are defined separately in multiple class diagrams.

To add inheritance associations between entities, use the class diagram as follows:

Add inheritance related

Operating procedure

  1. Add each entity that has an inheritance relationship to the class diagram.
  2. Move the pointer to the inheritance entity and drag the [▲] icon displayed in the four directions to drop it on the inheritance entity.
  3. When dropped, a pop-up for selecting the related type will appear, select Generalization from the choices.
  4. This defines the inheritance relationship between the entities and allows the fields of the inheriting entity to be used in the inheritance.

Delete association

There are several ways to remove associations between entities:

  • Remove association from metamodel
  • Remove associations from class diagram (hide them in class diagram without removing them from metamodel)

The method of deleting the relation is the same regardless of the type of relation.

Remove associations from metamodel

To remove an existing association from the metamodel in a class diagram, do the following:

Delete association from metamodel

Operating procedure

  1. If you want to remove the relationships used in the model, first remove the relevant relationships from the model.
  2. Select the association you want to delete from the metamodel in the class diagram and run Delete From Model from the context menu.

You can also remove the association from the metamodel by following the steps below.

Other operating procedures

  1. In the Profile Navigator, select the association you want to delete.
  2. Review the related details selected in the Inspector.
  3. Execute [Delete] from the context menu or press the Del key.

Note

  • Owned and inherited relationships are not displayed in the Profile Navigator, so delete them in the class diagram.
  • If the association you want to delete is not displayed in the class diagram, redisplay the hidden association and then delete it according to "Redisplay the association deleted from the class diagram" below.

Remove ### association from class diagram

To remove some associations from the class diagram and hide them, do the following:

Delete association from class diagram

Operating procedure

  1. Select the association you want to delete from the class diagram and execute [Delete From Diagram] from the context menu, or press the Del key.

To change the number of owned relations or change the reference relation to a bidirectional reference, use the Inspector as follows:

Change related settings

Operating procedure

  1. Click View> Pane> Inspector from the ribbon to display the Inspector on the right side of the screen.
  2. Select the target association in the class diagram or profile navigator.
  3. Select Metamodel in the tab at the top of the Inspector.
  4. To change the number of ownership-related data and constrain the number of models that can be added to the child, change Multiplicity in the Filelds group.
  5. To allow reference associations to be edited only from the referencing model, uncheck the IsTwoWay checkbox in the Relationship Class group.

Note

  • To see the field names that hold the association in the class diagram, turn on the Home> Class Diagram> Show Label toggle button from the ribbon.
  • Editing the label displayed on the relationship line changes the Display Name and Field Name of the field.

reference

Add fields to the association

Use the Inspector to add fields to reference and derivation associations.

Operating procedure

  1. Similar to the following procedure for an entity.

Metamodel definition> Entity field definition> Add field> Add field in Inspector

Remove field from association

To remove a field from reference and derivation associations, use the Inspector as you would add it.

Operating procedure

  1. Similar to the following procedure for an entity.

Redisplay the relationships deleted from the class diagram

To redisplay the relationships deleted from the class diagram or to display the relationships added outside the class diagram, follow the procedure below from the class diagram.

Redisplay deleted associations from class diagram

Operating procedure

  1. Select the related entities in the class diagram and select "Show Hidden Relationships" from the context menu.